/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DAO.banco;

/**
 *
 * @author Ricardo
 */

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConFactory {
private int DataBase;/*Conseito é criar um Swith para que possar ser usados varios bancos*/

private static final String MySQLDriver = "com.mysql.jdbc.Driver";
private static final String PostGreSQLDriver = "org.postgresql.Driver";

    public static Connection conexao(/*String url, String nome, String senha,int banco*/) throws SQLException{
        try{
            Class.forName(PostGreSQLDriver);
            return DriverManager.getConnection("jdbc:postgresql://localhost:5432/PresaPredador","postgres","123456");
        }catch(ClassNotFoundException e){
            throw new SQLException(e.getMessage());
        }
    }
}
